<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.eagle.commons.vo.tbl_PosOperatorDic"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>票据核销</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<jsp:include page="../common/easyui.jsp"></jsp:include>
	<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/util.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/dwr/engine.js"></script>
	<script type='text/javascript' src="<%=request.getContextPath()%>/dwr/interface/PrintDwr.js"></script>
	 <script type="text/javascript">
	 <% tbl_PosOperatorDic posoper = (tbl_PosOperatorDic)session.getAttribute("posoper");
       	  Integer posID = posoper.getBL_PosID();
       %>
	 $(function(){		
	 });
     	 //计算张数
     	 function num(){
     	 if ($('#endID').val()< $('#startID').val()) {
			 msg('票据截止号要大于起始号!');
			// document.getElementById('endst'+index).value="";
			  $('#endID').val('');
			   $('#InvCnt').val('');
			}
     	 var num=$('#endID').val()- $('#startID').val()+1;
     	 $('#InvCnt').val(num);
     	 }
     	  //确定录入
	 function insert(){
	 	   var inv=  $("#inv").val();
	 	    var startID=  $("#startID").val();
	 	     var endID=  $("#endID").val();
	 	      var invCnt=$('#InvCnt').val();
	 	     if (inv!="" && startID!="" && endID!="") {
	  	      PrintDwr.hx(inv,startID,endID,invCnt,function(data){
				if(data == "") {
				 $('#info')[0].reset();
					msg('操作成功');
				 }else {
				  msg(data);
				}
			});
			}else{
			 msg('信息不全！请填写完整信息');
			}
	 }
	  function msg(msg){
	  $.messager.show({
				 title:'系统提示',
				 msg:msg,
	 			 timeout:2000,
				 showType:'slide'
     			 });	
	 }
	 </script>
	 
  </head>
  
  <body>
   <div id="searchDiv" class="easyui-panel"  title="票据核销——查询提示" style="background-color:#EBF2FF;" collapsible="true">
		<p style="color: red;font-size: 20px">提示</p>
		<p style="margin-left: 20px">当票据出现以下情况时需要进行票据核销，录入到系统</p>
		<ul>
		<li>票据过期</li>
		<li>某种原因不再使用</li>
		</ul>
		<p style="margin-left: 20px">填写票据信息</p>
	</div>
	 <div id="birt" class="easyui-panel"  title="票据核销" style="background-color:#EBF2FF;height: 350"  collapsible="true">
	  <form id="info" method="post">
	   <table style="margin-left: 100px;margin-top: 20px" id="invTab">
		<tr> 
		<td>票据批次：
		<input class="easyui-validatebox" required="true"  id="inv"></td> 
		<td>票据起号：
		<input class="easyui-validatebox" required="true"  id="startID" onblur="num();"></td> 
		<td>票据止号：
		<input class="easyui-validatebox" required="true"  id="endID" onblur="num();"></td> 
		<td >共<input type="text" name="InvCnt" id="InvCnt" class="input" readonly />张 	</td>
		</tr> 
		</table> 
		<div align="center">
		<a href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-ok" onclick="insert()" >确定</a>
        <a href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-cancel" onclick=" $('#info')[0].reset();" >清空</a>
		</div>
		</form>
	 </div>
  </body>
</html>
